version: '3'
services:
  fl:
    build: .
    restart: always
    ports:
    - "5001:5000"
    volumes:
    - .:/app
    links:
    - mongo
  mongo:
    image: mongo:4.2.5-bionic
    restart: always
    environment:
      - MONGO_INITDB_ROOT_USERNAME=devroot
      - MONGO_INITDB_ROOT_PASSWORD=devroot
    #  - MONGO_INITDB_DATABASE=project
    volumes:
      - ./database:/data/db
      - ./database/configdb:/data/configdb
    ports:
       - "27017:27017"
    #   - 27018:27018
    #   - "27019:27019"
  mongo-express:
    image: mongo-express
    restart: always
    environment:
      # mongodb URI
      - ME_CONFIG_MONGODB_SERVER=mongo
      - ME_CONFIG_MONGODB_PORT=27017
      # mongodb authentication
      - ME_CONFIG_MONGODB_ADMINUSERNAME=devroot
      - ME_CONFIG_MONGODB_ADMINPASSWORD=devroot
       #- ME_CONFIG_MONGODB_ENABLE_ADMIN=false
       #- ME_CONFIG_MONGODB_AUTH_DATABASE=admin
       #- ME_CONFIG_MONGODB_AUTH_USERNAME=devroot
       #- ME_CONFIG_MONGODB_AUTH_PASSWORD=devroot

      # web login username and password
      - ME_CONFIG_BASICAUTH_USERNAME=dev
      - ME_CONFIG_BASICAUTH_PASSWORD=dev
    depends_on:
      - mongo
    ports:
      - "8888:8081"
# volumes:
#   mongo-data:
#   mongo-configdb:

  # services:

  # mongo:
  #   image: mongo
  #   restart: always
  #   environment:
  #     MONGO_INITDB_ROOT_USERNAME: root
  #     MONGO_INITDB_ROOT_PASSWORD: example

  # mongo-express:
  #   image: mongo-express
  #   restart: always
  #   ports:
  #     - 8081:8081
  #   environment:
  #     ME_CONFIG_MONGODB_ADMINUSERNAME: root
  #     ME_CONFIG_MONGODB_ADMINPASSWORD: example
  #     ME_CONFIG_MONGODB_URL: mongodb://root:example@mongo:27017/